﻿using System;
using System.IO;
using UnityEngine;
/// <summary>
/// 别名提示特性
/// </summary>
[AttributeUsage(AttributeTargets.Field, Inherited = true, AllowMultiple = false)]
public class ESF_SpriteAtlas_AssetBundleAttribute : ESF_AssetBundlePathAttribute
{
    /// <summary>
    /// 相对路径格式串
    /// </summary>
    string mRelativePathFormat = string.Empty;
    /// <summary>
    /// 构造函数
    /// </summary>
    /// <param name="_folder">文件夹路径</param>
    /// <param name="_relativePathFormat">相对路径格式串</param>
    /// <param name="_isIngoreLanguage">是否忽略语言包</param>
    /// <param name="_backgroundLoadingPriority">线程优先级</param>
    public ESF_SpriteAtlas_AssetBundleAttribute(enESF_LanguageRootFolder _folder, string _relativePathFormat,bool _isIngoreLanguage =false, int _backgroundLoadingPriority = en_ESF_ThreadPriority.Normal)
        : base(_folder, _relativePathFormat, _isIngoreLanguage, _backgroundLoadingPriority)
    {
        mRelativePathFormat = _relativePathFormat;
    }

    /// <summary>
    /// 获得相对资源路径
    /// </summary>
    /// <param name="_relativeAssetPath">相对资源路径</param>
    /// <param name="_lan">语言包</param>
    /// <returns>相对资源路径</returns>
    protected override string OnGetRelativeAssetPath(string _relativeAssetPath, enESF_LanguageClassify _lan) {
        return string.Format(mRelativePathFormat, _lan);
    }
}